#!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File    :   NRC22_Phy_test.py
@Time    :   2022/09/02 13:31:28
@Author  :   YangLiang
@Version :   1.0
@Contact :   yangliang@chengtech.com
@License :   (C)Copyright 2022-2025
@Desc    :   None
'''

# here put the import lib
from pickle import TRUE
from pytest_assume.plugin import assume

import pytest
import logging
import time
import requests
from sympy import I
# from sympy import assuming
from commDriver.TS_CAN import *
import allure
import sys
from collections.abc import Iterable

from sqlalchemy import false
sys.dont_write_bytecode = False


@allure.severity('critical')
class Test_SID0x10_NRC22_Phy(object):

    '''SID10 NRC22 test case 3E 00'''

    @allure.story('ECU NRC 22 Test')
    @allure.title('Test NRC22 of 0x10 Service Undervoltage in extended session with Physical Address')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_UnderVoltage_Extended_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service OverVoltage in extended session with Physical Address')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVoltage_Extended_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    
    @allure.title('Test NRC22 of 0x10 Service Vspeed over 3kph in extended session with Physical Address')
    @allure.description('Test 0x10 Service Vspeed over 3kph confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVspeed_Extended_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',80,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service undervoltage boundary in extended session with Physical Address')
    @allure.description('Test 0x10 Service undervoltage boundary confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_undervoltage_boundary_Extended_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.9, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.8, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x7F, 0x10, 0x22], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service overvoltage boundary in extended session with Physical Address')
    @allure.description('Test 0x10 Service 0vervoltage boundary confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_overvoltage_boundary_Extended_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.1, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    '''SID10 NRC22 test case 3E 80'''

    @allure.story('ECU NRC 22 Test')
    @allure.title('Test NRC22 of 0x10 Service Undervoltage in extended session with Physical Address')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_UnderVoltage_Extended_Send3E80_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service OverVoltage in extended session with Physical Address')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVoltage_Extended_Send3E80_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    
    @allure.title('Test NRC22 of 0x10 Service Vspeed over 3kph in extended session with Physical Address')
    @allure.description('Test 0x10 Service Vspeed over 3kph confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVspeed_Extended_Send3E80_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',80,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service undervoltage boundary in extended session with Physical Address')
    @allure.description('Test 0x10 Service undervoltage boundary confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_undervoltage_boundary_Extended_Send3E80_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.9, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.8, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x7F, 0x10, 0x22], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)

    @allure.title('Test NRC22 of 0x10 Service overvoltage boundary in extended session with Physical Address')
    @allure.description('Test 0x10 Service 0vervoltage boundary confition response NRC22 in extended session with physical addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_overvoltage_boundary_Extended_Send3E80_Phy(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.1, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1022', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '5002', 0, iStep, False)



class Test_SID0x10_NRC22_Fun(object):

    '''SID10 NRC22 test case 3E 00'''

    @allure.story('ECU NRC 22 Test')
    @allure.title('Test NRC22 of 0x10 Service Undervoltage in extended session with  Functional Address')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_UnderVoltage_Extended_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service OverVoltage in extended session with  Functional Address')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVoltage_Extended_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    
    @allure.title('Test NRC22 of 0x10 Service Vspeed over 3kph in extended session with  Functional Address')
    @allure.description('Test 0x10 Service Vspeed over 3kph confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVspeed_Extended_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',80,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service undervoltage boundary in extended session with  Functional Address')
    @allure.description('Test 0x10 Service undervoltage boundary confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_undervoltage_boundary_Extended_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.9, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x10, 0x02], [0x50, 0x02], 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.8, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service overvoltage boundary in extended session with  Functional Address')
    @allure.description('Test 0x10 Service 0vervoltage boundary confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_overvoltage_boundary_Extended_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.1, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '220285', '620285', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E00', '7E00', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    
    '''SID10 NRC22 test case 3E 80'''

    @allure.story('ECU NRC 22 Test')
    @allure.title('Test NRC22 of 0x10 Service Undervoltage in extended session with  Functional Address')
    @allure.description('Test 0x10 Service Undervoltage confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_UnderVoltage_Extended_Send3E80_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service OverVoltage in extended session with  Functional Address')
    @allure.description('Test 0x10 Service OverVoltage confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVoltage_Extended_Send3E80_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    
    @allure.title('Test NRC22 of 0x10 Service Vspeed over 3kph in extended session with  Functional Address')
    @allure.description('Test 0x10 Service Vspeed over 3kph confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_OverVspeed_Extended_Send3E80_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        #设置车速大于3KM/H
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',80,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        iStep = Driver['CAN'].setSignalValue('abs_sts_run1', 'abs_pm_veh_spd',0,iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service undervoltage boundary in extended session with  Functional Address')
    @allure.description('Test 0x10 Service undervoltage boundary confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_undervoltage_boundary_Extended_Send3E80_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.9, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.8, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, [0x22, 0x02,0x85], [0x62, 0x02,0x85], 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 6.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(0.3)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 0.5, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')

    @allure.title('Test NRC22 of 0x10 Service overvoltage boundary in extended session with  Functional Address')
    @allure.description('Test 0x10 Service 0vervoltage boundary confition response NRC22 in extended session with  Functional addressing')
    @allure.testcase('Test cases address:https://chengtech.pingcode.com/testhub/libraries/630357052177ea2394680877/cases')
    def test_SID10_overvoltage_boundary_Extended_Send3E80_Fun(self, action, Driver):
        iStep = 1
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.1, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 17.5, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '220285', '620285', 0, iStep, False)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 18.3, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 0, iStep, False)
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')
        time.sleep(1)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '3E80', '', 3, iStep, False)
        iStep = Driver['CAN'].SetVolt(Driver, 12, 1, iStep)
        iStep, uds_resp, size = Driver['CAN'].checkReqResp(Driver, '1002', '7F1012', 0, iStep, False, 'UDSFun')